<template>
  <div class="cart">
    <SelectTheRegion v-if="props.itemData.id == draggableItem.id" @delItem="delItem"></SelectTheRegion>
    <div class="grid-content ep-bg-purple"></div>
    <div class="grid-content ep-bg-purple"></div>
    <div class="grid-content ep-bg-purple"></div>
    <div class="grid-content ep-bg-purple"></div>
    <div class="grid-content ep-bg-purple"></div>
    <div class="grid-content ep-bg-purple"></div>
    
  </div>
</template>

<script setup lang="ts">
import SelectTheRegion from '@/pages/lowCode/components/lowCodeAdd/lowCodeContent/selectTheRegion/index.vue';
import { storeToRefs } from 'pinia';
import { lowCode } from '@/store/modules/lowCode';
const lowCodeStore = lowCode();
const { draggableItem } = storeToRefs(lowCodeStore);
const props: any = defineProps({
  itemData: {
    type: Object,
    default: [],
  },
  del: {
    type: Function, // 假设 del 是一个函数类型的 prop
  },
});
const delItem = () => {
  console.log('卡片作妖');
  props.del(props.itemData);
};
</script>

<style lang="scss" scoped>
.cart {
  width: 100%;
  height: 50px;
  // margin: 2px 0px;
  display: flex;
  justify-content: space-between;
  position: relative;
  .grid-content {
    width: 16.5%;
    height: 100%;
    border-radius: 5px;
    background-color: var(--el-color-primary);
  }
}
</style>
